package com.cloud.seatatmone.controller;

import com.cloud.seatatmone.service.Seata_AT_Service;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Main_Model_AT_Controller {

    @Autowired
    private Seata_AT_Service service;


    @PostMapping("/test_AT")
    // 这是开启 seata 分布式事务的入口，AT模式和 TCC模式都需要
    @GlobalTransactional(rollbackFor = Exception.class)
    public String testAT(){
        return service.testAT();
    }
}
